package yunjiao.javatutorials.designpatterns.visitor.example1.items;

import lombok.Data;

/**
 * TODO
 *
 * @author yangyunjiao
 */
@Data
public class Book implements ShopItem {

    private String title;
    private double pricePerUnit;

    public Book(String title, double pricePerUnit) {
        this.title = title;
        this.pricePerUnit = pricePerUnit;
    }

    @Override
    public String getName() {
        return getTitle();
    }

    @Override
    public double getPrice() {
        return getPricePerUnit();
    }

    @Override
    public double getWeight() {
        return 0.0d;
    }

    @Override
    public ShopItemCategory getCategory() {
        return ShopItemCategory.BOOK;
    }

    @Override
    public String toString() {
        return "Book [title=" + title +
                ", price=" + getPrice() +
                "]";
    }
}
